/*
 * GameListWindow.h
 *
 *  Created on: 05/06/2014
 *      Author: lucio
 */

#ifndef GAMELISTWINDOW_H_
#define GAMELISTWINDOW_H_
#include <gtkmm.h>
#include <gtkmm/window.h>
#include <vector>
#include "CreateGameWindow.h"
#include "campaign_info.h"
#include "game_info.h"
#include "GameListModel.h"

class GameListWindow : public Gtk::Window {
protected:
	Gtk::Button* JoinButton;
	Gtk::Button* CreateButton;
	Gtk::Button* RefreshButton;

	Gtk::TreeView* GameList;
	Glib::RefPtr<Gtk::ListStore> ListStore;
	GameListModel model;

	Gtk::Image* PreviewImage;

	CreateGameWindow* CreateWindow;
	CampaingInfo selectedCampaingInfo;
	std::vector<GameInfo> games;

	void JoinButton_clicked();
	void CreateButton_clicked();
	void RefreshButton_clicked();
	void ChangePreviewImage();
public:
	Glib::RefPtr<Gtk::Builder> builder;

	GameListWindow(BaseObjectType* object,
			const Glib::RefPtr<Gtk::Builder> &Builder);
	virtual ~GameListWindow();

private:
	void CreateGame();
	void CreateGameList();
};

#endif /* GAMELISTWINDOW_H_ */
